Ext.define('NIM.view.Administration.AssetSubCategoryGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.asset_subcategory_grid',
    region: 'center',
    id: 'table_assetCategorySub',
    height: 590,
    width: 400,
    titleAlign: 'center',
    margin: '5 5 5 0',
    border: true,
    forceFit: true,
    columnLines: true,
    selType: 'checkboxmodel',
    store: 'Administration.AssetCategorySub',
    title: 'Asset Category List',
    columns: [
        {dataIndex: 'MAIN_CATEGORY', text: 'MAIN CATEGORY', align: 'left'},
        {dataIndex: 'SUB_CATEGORY_1', text: 'SUB CATEGORY 1', align: 'left'},
        {dataIndex: 'SUB_CATEGORY_2', text: 'SUB CATEGORY 2', align: 'left'},
        {dataIndex: 'SUB_CATEGORY_3', text: 'SUB CATEGORY 3', align: 'left'},
        {dataIndex: 'CATEGORY', text: 'CATEGORY', align: 'left'},
        {dataIndex: 'STATUS', text: 'STATUS', align: 'left'}

    ],
    dockedItems: [
        {
            xtype: 'pagingtoolbar',
            dock: 'bottom',
            store: 'Administration.AssetCategorySub',
            displayInfo: true
        },
        {
            xtype: 'toolbar',
            dock: 'top',
            items: [
                {
                    xtype: 'textfield',
                    fieldLabel: 'KEYWORD',
                    id: 'keywordCategorySub',
                    margin: '0 0 0 10',
                },
                {
                    xtype: 'button',
                    text: 'SEARCH',
                    id: 'searchCategorySub',
                    margin: '0 30 0 0',
                    handler: function () {
                        SearchAssetCategorySub();
                    }
                },
                {
                    xtype: 'button',
                    text: 'REFRESH',
                    id: 'refreshCategorySub',
                    handler: function () {
                        RefreshAssetCategory();
                    }
                }
            ]
        }
    ],
    listeners: {
        afterrender: function () {
            Ext.getStore('Administration.AssetCategorySub').load();

        },
        itemdblclick: function (grid, record) {
            if (Ext.getCmp('ConfigAssetSubCategory').hidden == true)
                Ext.getCmp('ConfigAssetSubCategory').toggleCollapse(true);
            getValueGridAssetSubCategory0(record);
        },
    },
});